package Pojo;

import java.util.Objects;

//管理员实体类
public class Admin {
    private Integer admin_id;//管理员id(主键)
    private String admin_name;//管理员名称

    //无参构造
    public Admin() {

    }
    //有参构造
    public Admin(Integer admin_id, String admin_name) {
        this.admin_id = admin_id;
        this.admin_name = admin_name;
    }
    //get set 方法
    public Integer getAdmin_id() {
        return admin_id;
    }

    public void setAdmin_id(Integer admin_id) {
        this.admin_id = admin_id;
    }

    public String getAdmin_name() {
        return admin_name;
    }

    public void setAdmin_name(String admin_name) {
        this.admin_name = admin_name;
    }
    //equals hashcode方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Admin admin = (Admin) o;
        return Objects.equals(admin_id, admin.admin_id) &&
                Objects.equals(admin_name, admin.admin_name);
    }
    @Override
    public int hashCode() {
        return Objects.hash(admin_id, admin_name);
    }
    //toString输出重写方法
    @Override
    public String toString() {
        return "Admin{" +
                "admin_id=" + admin_id +
                ", admin_name='" + admin_name + '\'' +
                '}';
    }
}
